/*****************************************************************************************
Arise Engine		EditorSettings.cpp

					E-mail:	arise_engine@mail.ru

created:			18.03.2007
last changes:		13.02.2008
*****************************************************************************************/
#include "stdafx.h"

#include "..\engine\Settings.h"


//aLogfile g_log(LOG_OUTPUT_FILE, ARISE_EDITOR_VERSION);



EditorSettings::EditorSettings()
{
	fullscreen_resolution	= 0;

	rotate_vertical		= 0.003f;
	rotate_horizontal	= 0.003f;
	scale				= -0.3f;
	mouse_wheel_step	= 120.0f;
	step_forward		= 10.0f;
	step_right			= 10.0f;
	step_scale			= 0.5f;
	sensitivity			= 0.003f;
}
EditorSettings::~EditorSettings()
{
}


bool EditorSettings::LoadFromFile(FileData* file)
{
	if(!file) return false;	
	if(!m_editor_config.LoadFromFile(file)) return false;

	//is_vsync			= (bool) m_editor_config.GetInt("editor", "vsync", 0);
	fullscreen_resolution	= m_editor_config.GetInt("editor", "resolution", 2);

	rotate_vertical		= m_editor_config.GetFloat("editor", "rotate_vertical", 0.003f);
	rotate_horizontal	= m_editor_config.GetFloat("editor", "rotate_horizontal", 0.003f);
	scale				= m_editor_config.GetFloat("editor", "scale", -0.3f);
	mouse_wheel_step	= m_editor_config.GetFloat("editor", "mouse_wheel_step", 120.0f);
	pan_view			= m_editor_config.GetFloat("editor", "pan_view", 120.0f);
	step_forward		= m_editor_config.GetFloat("editor", "step_forward", 10.0f);
	step_right			= m_editor_config.GetFloat("editor", "step_right", 10.0f);
	step_scale			= m_editor_config.GetFloat("editor", "step_scale", 0.5f);
	sensitivity			= m_editor_config.GetFloat("editor", "sens", 0.003f);

	return true;
}


